package com.company;
//anthor:XM YQL


import com.sun.deploy.security.SelectableSecurityManager;

public class yuan {
    //R
    private double radius;
    //L
    private double perimete;
    //S
    private double area;


    public yuan() {

    }

    public yuan(double radius) {
        this.radius = radius;
    }

    public void setRadius(double radius) {
        if (radius < 0) {
            System.err.println("r must over 0");
        } else {
            this.radius = radius;
        }
    }


    public double getPerimete() {
        perimete = 2 * Math.PI * radius;
        return perimete;
    }

    public double getArea() {
        area = Math.PI * radius * radius;
        return area;
    }

    public void show() {
        System.out.println("banjing wei :" + this.radius);
        String str1 = String.format("zhouchang wei : %.2f", this.getPerimete());
        String str2 = String.format("mianji wei : %.2f", this.getArea());
        System.out.println(str1);
        System.out.println(str2);

    }
}
